<template>
    <view>
        <view class="" v-for="item in from">
            <view class="" style="position: relative;">
                <view class="mingcheng czjz y">
                    <p class="gang spjz">{{item.name}}</p>
                    <p>{{item.floorPrice}}起</p>
                </view>
                <image :src="item.picUrl" style="width: 750rpx;height: 400rpx;"></image>
            </view>
            <view class="jieshao spcz">
                {{item.desc}}
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                from: [], //商品数据
                loadSwitch: false,
                page: 1, //起始页
            }
        },
        onLoad() {
            uni.request({
                url: "http://47.91.230.137:8086/wx/brand/list",
                success: (res) => {
                    console.log(res)
                    this.from = res.data.data.list
                }
            })
        },
        // 上拉加载方法
        onReachBottom() {
            console.log("我被触发了")
            //  如果当前页数大于等于总页数，状态修改为没有更多了，不在继续往下执行代码
            uni.showLoading({
                title: "加载中"
            })
            if (this.loadSwitch) {
                this.loadSwitch = false;
                this.page = this.page + this.per_page
                setTimeout(() => {
                    this.getGoodsList(this.tota2[0]['id']);
                }, 1200);
            } else {
                uni.hideLoading()
            }
        },
        methods: {

        }
    }
</script>

<style>
    .mingcheng {
        position: absolute;
        padding-top: 160rpx;
        width: 100%;

    }

    .mingcheng p {
        font-size: 50rpx;
        color: #ffffff;
    }

    .gang {
        width: 90%;
        border-bottom: #ffffff solid 6rpx;
    }

    .jieshao {
        width: 90%;
        margin: auto;
        font-size: 39rpx;
        padding-top: 30rpx;
        padding-bottom: 40rpx;
    }
</style>